package com.mytest.leetcode;

import lombok.extern.slf4j.Slf4j;

/**
 * Created by shixi  on 2020/1/17
 */
@Slf4j
public class Solution136 {

    public static void main(String[] args) {
        Solution136 solution121 = new Solution136();

        int result = solution121.singleNumber(new int[]{4,1,2,1,2});

        log.info("{}",result);
    }


    public int singleNumber(int[] nums) {
        int single = 0;
        for(int i : nums){
            single ^= i;
        }
        return single;
    }
}
